package interview.huawei.tjt.training.huaweijishitiku;

import java.util.Scanner;

// 在字符串中找出连续最长的数字串
public class HJ92 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while ( sc.hasNextLine() ) {
            String str = sc.nextLine();
            int max = 0;
            String string = null;
            for ( int i = 0; i < str.length(); i ++ ) {
                if ( str.charAt(i) >= '0' && str.charAt(i) <= '9' ) {
                    int start = i;
                    while ( i < str.length() && str.charAt(i) >= '0' && str.charAt(i) <= '9' ) {
                        i ++;
                    }
                    int len = i - start;
                    if (len > max) {
                        max = len;
                        string = str.substring(start,i);
                    } else if (len == max) {
                        string = string + str.substring(start,i);
                    }
                }
            }
            System.out.println(string + "," + max);
        }
    }

}
